import request from '@/config/axios'

// syslog VO
export interface SyslogVO {
  id: number // ID
  content: string // 内容
  aiResponse: string // 分析结果
  status: number // 状态（0正常 1停用）
  remark: string // 备注
}

// syslog API
export const SyslogApi = {
  // 查询syslog分页
  getSyslogPage: async (params: any) => {
    return await request.get({ url: `/research/syslog/page`, params })
  },

  // 查询syslog详情
  getSyslog: async (id: number) => {
    return await request.get({ url: `/research/syslog/get?id=` + id })
  },

  // 新增syslog
  createSyslog: async (data: SyslogVO) => {
    return await request.post({ url: `/research/syslog/create`, data })
  },

  // 修改syslog
  updateSyslog: async (data: SyslogVO) => {
    return await request.put({ url: `/research/syslog/update`, data })
  },

  // 删除syslog
  deleteSyslog: async (id: number) => {
    return await request.delete({ url: `/research/syslog/delete?id=` + id })
  },

  // 导出syslog Excel
  exportSyslog: async (params) => {
    return await request.download({ url: `/research/syslog/export-excel`, params })
  },

  // 分析syslog
  analysisSyslog: async (data: SyslogVO) => {
    return await request.post({ url: `/research/syslog/analysis`, data })
  },
}
